home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Answers 2002 January
/
PC Answers January 2002.7z
/
PC Answers January 2002.bin
/
graphics
/
freepixl
/
_SETUP.1
/
Patterns.pxl
< prev
next >
Wrap
Text File
|
2000-12-23
|
2KB
|
105 lines
Initialize:
Title$ = "Using pattern Fill functions"
UseCaption(Title$)
UseCoordinates(PIXEL)
SetColorPalette(BITMAP)
UseBackground(TRANSPARENT,166,166,166)
DrawBackground
WinLocate(Title$,300,200,790,500,Res)
WinGetClientRect("",cx1,cy1,cx2,cy2)
DirGet(SourceDir$)
Patt1$ = SourceDir$ + "\pattern1.bmp"
Patt2$ = SourceDir$ + "\pattern2.bmp"
Patt3$ = SourceDir$ + "\pattern3.bmp"
Patt4$ = SourceDir$ + "\pattern4.bmp"
LoadBitmap(Patt1$,FULL)
LoadBitmap(Patt2$,FULL)
LoadBitmap(Patt3$,FULL)
LoadBitmap(Patt4$,FULL)
WaitInput(1)
WinShow(Title$,TOPMOST,Res)
InfoMenu(REMOVE)
WaitInput(100)
SetMenu("E&xit!",Leave,
ENDPOPUP,
"Flood",IGNORE,
"Std Color Modes", Solid_Color,
"Pattern brush",Bitmap_Color,
"Grids",DrawingGrids,
ENDPOPUP)
Wait_for_Input:
WaitInput()
Leave:
End
DrawingGrids:
DrawBackground
WinGetClientRect("",cx1,cy1,cx2,cy2)
UseBrush(NULL,0,0,0)
DrawGrid(cx1,cy1,cx2,cy2, 22, 22, 255,255,255, NONE)
UseBrush(SOLID,255,255,255)
DrawGrid(100,100, 400, 300, 51,51, 128,0,0, STYLE_2)
SetMouse(100,100, 400, 300,DrawPat1,x,y)
SetCtrlMouse(100,100, 400, 300,DrawPat2,x,y)
SetRightMouse(100,100, 400, 300,DrawPat3,x,y)
SetCtrlRightMouse(100,100, 400, 300,DrawPat4,x,y)
Goto Wait_for_Input
DrawPat1:
UseBrushPattern(Patt1$)
DrawFlood(x,y,128,0,0)
Goto Wait_for_Input
DrawPat2:
UseBrushPattern(Patt2$)
DrawFlood(x,y,128,0,0)
Goto Wait_for_Input
DrawPat3:
UseBrushPattern(Patt3$)
DrawFlood(x,y,128,0,0)
Goto Wait_for_Input
DrawPat4:
UseBrushPattern(Patt4$)
DrawFlood(x,y,128,0,0)
Goto Wait_for_Input
Solid_Color:
DrawBackground
WinGetClientRect("",cx1,cy1,cx2,cy2)
UsePen(SOLID,2,0,0,0)
UseBrush(NULL,255,255,0)
DrawRectangle(cx1,cy1,cx2,cy2)
UseBrush(SOLID,255,255,0)
DrawRectangle(100,50,200,150)
UseBrush(CROSS,255,0,0)
DrawFlood(120,70,0,0,0)
UseBrush(CROSS,255,0,0)
GetBackground(r,g,b)
DrawFloodExt(90,50,r,g,b,SURFACE)
Goto Wait_for_Input
Bitmap_Color:
DrawBackground
WinGetClientRect("",cx1,cy1,cx2,cy2)
UsePen(SOLID,2,0,0,0)
UseBrush(NULL,255,255,0)
DrawRectangle(cx1,cy1,cx2,cy2)
UseBrush(SOLID,255,255,0)
DrawRectangle(100,50,200,150)
UseBrush(DIAGONALCROSS,255,0,0)
DrawRectangle(100,50,200,150)
UseBrushPattern(Patt3$)
DrawTriangle(240,70,320,120,290,20)
UseBrushPattern(Patt4$)
GetBackground(r,g,b)
DrawFloodExt(90,50,r,g,b,SURFACE)
Goto Wait_for_Input